package club.ljwang.controller;

import club.ljwang.entity.Result;
import club.ljwang.pojo.OrderInfo;
import club.ljwang.service.OrderService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: ming
 * @date: 2020/3/9-12:49
 * @Version: 1.0.0
 */
@RestController
@RequestMapping("order")
public class OrderController {
    @Reference
    private OrderService orderService;

    @RequestMapping("submit")
    public Result submit(@RequestBody OrderInfo orderInfo){
        Result result = orderService.submit(orderInfo);
        return result;
    }

    @RequestMapping("findById")
    public Result findById(Integer id) {

        return orderService.findById(id);

    }
}
